#ifndef RANDOM_H
#define RANDOM_H

#include <cstdlib>

class Random {

public:
	static Random& getInstance();

	Random();

	bool   getBool();
	bool   getBool(double probability);
	double getDouble();
	double getDouble(double range);
	double getDoubleCentered(double range);
	int    getInt(int range);
	long   getLong(long range);
	long   getLongCentered(long range);

private:

	static Random* _instance;
};

inline
int Random::getInt(int range) {
	return int(double(random()) * range / (double(RAND_MAX) + 1.0));
}

#endif	// RANDOM_H

